<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			// function Humans() {
			// 	this.clothing = ["trousers", "dress", "jacket"];
			// }

			// function Man() {}
			// //继承了Humans
			// Man.prototype = new Humans();
			// var man1 = new Man();
			// man1.clothing.push("coat");
			// alert(man1.clothing);
			// var man2 = new Man();
			// alert(man2.clothing);
			function Humans(name) {
				this.name = name;
			}

			function Man(name,age) {
				//Humans.call(this, name); //继承了Humans,同时还传递了参数
				Humans.apply(this, arguments); 
				this.age = age; //实例属性
			}
			var man1 = new Man("尼古拉斯。定国",20);
			alert(man1.name); //输出mary
			alert(man1.age);
			alert(man1 instanceof Humans);//????
		</script>
	</head>
	<body>
	</body>
</html>
